package com.espirit.weixin.message;

import java.util.ArrayList;
import java.util.List;

public class ArticleMessage extends BaseMessage {
	// 图文消息个数，限制为10条以内
	private Integer articleCount;
	// 多条图文消息信息，默认第一个item为大图
	private List<Article> articles;

	public Integer getArticleCount() {
		return articleCount;
	}

	public void setArticleCount(Integer articleCount) {
		this.articleCount = articleCount;
	}

	public List<Article> getArticles() {
		return articles;
	}

	public void setArticles(List<Article> articles) {
		this.articles = articles;
		this.articleCount = this.articles == null ? 0 : this.articles.size();
	}
	
	public void addArticle(Article article) {
		if (this.articles == null) {
			this.articles = new ArrayList<>(10);
		}
		this.articles.add(article);
		this.articleCount = this.articles.size();
	}
}
